
<!DOCTYPE html>
<html>
	</head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><?php echo $title?></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
                <link rel="icon" type="image/ico" href="./favicon.ico" />

		<!-- Les styles -->
		<link href="./css/bootstrap.css" rel="stylesheet">
                <!--<link href="./css/sticky-footer.css" rel="stylesheet">-->
		<style type="text/css">
                body {
			padding-top: 60px;
		  }
                  
                footer {
                    color: #666;
                    background: #222;
                    padding: 17px 0 18px 0;
                    border-top: 1px solid #000;
                    text-align: center;
                        
                }
                footer a {
                    color: #999;
                }
                footer a:hover {
                    color: #efefef;
                }
		</style>
		<link href="./css/bootstrap-responsive.css" rel="stylesheet">

		<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
		  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
           
                <!--javascript -->
                <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
                <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
                <script src="./js/prettify.js"></script>
                <script src="./js/bootstrap-transition.js"></script>
                <script src="./js/bootstrap-alert.js"></script>
                <script src="./js/bootstrap-modal.js"></script>
                <script src="./js/bootstrap-dropdown.js"></script>
                <script src="./js/bootstrap-scrollspy.js"></script>
                <script src="./js/bootstrap-tab.js"></script>
                <script src="./js/bootstrap-tooltip.js"></script>
                <script src="./js/bootstrap-popover.js"></script>
                <script src="./js/bootstrap-button.js"></script>
                <script src="./js/bootstrap-collapse.js"></script>
                <script src="./js/bootstrap-carousel.js"></script>
                <script src="./js/bootstrap-typeahead.js"></script>
                <!--/javascript-->
        
	</head>
    <body>
        
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <!--logotype--><a class="brand" href="./">BDE Management</a><!--/logotype-->
                    <ul class="nav">
                    <li >
                        <a href="search.php">Rechercher</a>
                    </li>

                    <!--Profil -->
                    <?php
                    //si l'utilisateur est connecté, on renvoie le lien Profil à sa page de profil perso
                    //sinon, on renvoie à la page de connexion
                    if(isset($p) && $p->IsConnected())
                        echo '<li><a href="profil.php?login='.$p->GetLogin().'">Profil</a></li>';
                    else
                        echo '<li><a href="connexion.php">Profil</a></li>';
                    ?>
                    <!--/Profil-->
                    
                    <!--Assos-->
                    <li class="dropdown active">
                        <a href="" class="dropdown-toggle" data-toggle="dropdown">Mes Associations<b class="caret"></b></a>
                            <ul class="dropdown-menu">
                            <?php
                                if(isset($p) && $p->IsConnected()){
                                    $assos=$p->GetAsso($db);
                                    
                                    if(isset($assos[GetSemester()])&&!is_null($assos[GetSemester()])){
                                        $assosDuSemestre=array_keys($assos[GetSemester()]);
                                        foreach($assosDuSemestre as $k=> $v)
                                            echo '<li><a href="asso.php?nom='.$v.'">'.$v.'</a></li>';

                                            echo '<li class="divider"></li>';
                                    }
                                }

                                echo '<li><a href="search.php">Rechercher une asso</a></li>';
                            ?>
                            </ul>
                    </li>
                    </ul>
                    <!--/Assos-->
                    
                    <!--Bouton Connexion-->
                    <div class="pull-right btn-group">
                        <?php if(isset($p) && $p->IsConnected()){
                            //si l'utilisateur est connecté, on affiche son nom
                            //et un lien pour se déconnecter
                            ?>

                                <a class="btn dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-user"></i>
                                    <?php $p->FillFromLogin($db);
                                        echo $p->GetNomComplet();?>
                                    <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a href="deconnexion.php">Déconnexion</a></li>
                                    <li><a href="inscription.php">Inscrire un nouveau membre</a></li>
                                </ul>
                        
                        <?php } else{ //sinon, on crée un lien vers la page de connexion ?>
                                    <a class="btn dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-user"></i>Utilisateur
                                    <span class="caret"></span>
                                    </a>
                                    <ul class="dropdown-menu">
                                        <li><a href="connexion.php">Se connecter</a></li>
                                        <li><a href="inscription.php">Inscription</a></li>
                                    </ul>
                        <?php }  ?>
                    </div>
                </div>
            </div>
        </div>





